package org.hd.permission.controller;

import cn.dev33.satoken.util.SaResult;
import org.hd.permission.service.PermissionService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/permission/")
public class PermissionController {

    @Resource
    PermissionService permissionService;

    /***
     * 获取权限列表
     * @return
     */
    @RequestMapping("/getRightList")
    public SaResult getRightList(){
        List<Map<String, String>> rightList = permissionService.getRightList();
        if(rightList != null){
            return new SaResult(200,"获取成功",rightList);
        }
        return SaResult.error("获取失败");
    }
}
